class ScoreAnimationSystem extends System {
    constructor(world) {
        super(world);
    }

    execute() {
        for (const entity of this.getWorld().getEntities()) {
            const scoreComponent = entity.getComponent(ScoreComponent);
            if (scoreComponent) {
                const progress = Math.min(1, scoreComponent.progress + 0.002 * time.delta);
                scoreComponent.progress = progress;
                if (progress >= 1) {
                    this.getWorld().removeEntity(entity);
                }
            }
        }
    }
}